<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common.inc" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="./css/style1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./js/form.js"></script>
<script type="text/javascript" language="javascript">
<!--
	function back(){
		window.location.href = "./saleCost.do";
		window.location.target = "main";
	}
	
	function viewSaleCost(saleCostCode){
		window.location.href = "./saleCost.do?action=viewSaleCost&saleCostCode="+saleCostCode+"&sign=4";
		window.location.target = "main";
	}
	
	function advancedAuery(){
		window.location.href = "advancedAuery.html";
		window.location.target = "main";
	}
	
	function advancedQueryDialog(){
		var url = "advancedAuery.html";
		var dlgParam = "dialogHeight:360px;dialogWidth:450px;dialogTop:300px;dialogLeft:400px;status:no;help:no;scrollbars:yes;";
		window.showModalDialog(url,"",dlgParam);
	}
	
	function searchSaleCost(){
		var saleCostCode = document.getElementById("saleCostCode");
		if(saleCostCode.value == ""){
			alert("请输入要查找的单据编号!");
		}else{
			document.getElementById("sFlag").value = "1";
			document.deptSaleCostForm.action = "./saleCost.do?action=deptSaleCost";
			document.deptSaleCostForm.target = "main";
			document.deptSaleCostForm.submit();
		}
	}
	
	function pageContract(flag){
		document.deptSaleCostForm.action = "./saleCost.do?action=deptSaleCost&flag="+flag;
		document.deptSaleCostForm.target = "main";
		document.deptSaleCostForm.submit();
	}
	
-->
</script>
</head>
<body>
<form name="deptSaleCostForm" action="" method="post">
	<table class="table_frame">
		<tr>
			<td>
				<table class="table_title1">
					<tr>
						<td class="title_lab">部门费用</td>
					</tr>
					<tr>
						<td valign="bottom" class="a_tools" style="padding-left: 3px;">单据编号：
							<input id="saleCostCode" name="saleCostCode" class="input_query" type="text" value="${saleCostCode}"/>
							<input id="sFlag" name="sFlag" type="hidden" value="${sFlag}"/>
							<a class="search" href="javascript:searchSaleCost();" target="main" hidefocus="true">查询</a>
						</td>
						<!-- 
						<td></td>
						<td valign="bottom" align="right">
							<a href="javascript:back();" hidefocus="true">返回费用列表</a>&nbsp;&nbsp;
						</td>
						 -->
					</tr>
					<tr><td height="2"></td></tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table class="table_title2">
					<tr>
						<td class="title_lab">部门费用</td>
						<td align="right" valign="">
							<!-- page -->
							<table class="table_page2">
								<tr>
									<td valign="bottom">
										<img src="./images/frist.bmp" onclick="pageContract(1)" alt="首页" style="vertical-align: middle;cursor: hand;">
										<img src="./images/last.bmp" onclick="pageContract(2)" alt="上一页" style="vertical-align: middle;cursor: hand;">&nbsp;
										<font color="red">${currentPage}</font>/${totalPages}&nbsp;<fmt:message key='common.page'/>&nbsp;
										<img src="./images/next.bmp" onclick="pageContract(3)" alt="下一页" style="vertical-align: middle;cursor: hand;">
										<img src="./images/end.bmp" onclick="pageContract(4)" alt="末页" style="vertical-align: middle;cursor: hand;">
										共&nbsp;&nbsp;${totalRows}&nbsp;<fmt:message key='common.page.totalRow'/>&nbsp;&nbsp;&nbsp;
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr><td colspan="3" height="2"></td></tr>
					<tr>
						<td colspan="2">
							<table class="table">
								<tr>
									<td valign="top">
										<!-- 
										<div style="width:800px;height:100%;overflow-x: scroll;overflow-y: hidden;">
										 -->
										<table class="table_style">
											<tr>
												<td class="title" width="8"></td>
												<td class="title" width="">单据编号</td>
												<td class="title" width="15%">金额(元)</td>
												<td class="title" width="12%">申请人</td>
												<td class="title" width="12%">审核人</td>
												<td class="title" width="15%">审核日期</td>
											</tr>
											<c:forEach var="saleCost" items="${saleCosts}">
											<tr onmouseover="onmousemoveChange(this,'img${saleCost.id}')" onmouseout="onmouseoutChange(this,'img${saleCost.id}')">
												<td height="16" width="8" align="right"><img id="img${saleCost.id}" src="./images/table_sign2.bmp"></td>
												<td><a href="javascript:viewSaleCost('${saleCost.saleCostCode}');" target="main">${saleCost.saleCostCode}</a></td>
												<td>${saleCost.costValue}</td>
												<td>${saleCost.applyPerson}</td>
												<td>${saleCost.auditPerson}</td>
												<td><fmt:formatDate value="${saleCost.auditDate}" pattern="yyyy-MM-dd"/></td>
											</tr>
											</c:forEach>
										</table>
										<!-- 
										</div>
										 -->
									</td>
								</tr>
								<tr>
									<td align="left" valign="bottom">
										<!-- page -->
										<table id="tp" class="table_page">
											<tr>
												<td>&nbsp;&nbsp;
													<img src="./images/frist.bmp" onclick="pageContract(1)" alt="首页" style="vertical-align: middle;cursor: hand;">
													<img src="./images/last.bmp" onclick="pageContract(2)" alt="上一页" style="vertical-align: middle;cursor: hand;">&nbsp;
													<font color="red">${currentPage}</font>/${totalPages}&nbsp;<fmt:message key='common.page'/>&nbsp;
													<img src="./images/next.bmp" onclick="pageContract(3)" alt="下一页" style="vertical-align: middle;cursor: hand;">
													<img src="./images/end.bmp" onclick="pageContract(4)" alt="末页" style="vertical-align: middle;cursor: hand;">
													共&nbsp;&nbsp;${totalRows}&nbsp;<fmt:message key='common.page.totalRow'/>
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</form>
</body>
</html>